'and install it into your /foobar2000/components/ directory.
'TODO:
'- Testing
Class foobar2000
Private m_Self
Private mainMenu
'Some info about the plugin
Public Property Get SHOWABLE 'Do I have a menu?
SHOWABLE = True
End Property
Public Property Get TITLE 'What's my name?
TITLE = "foobar2000"
End Property
Public Property Get DESCRIPTION 'What's my purpose?
DESCRIPTION = "Lets you control foobar2000"
End Property
Public Property Get AUTHOR 'Who created me?
AUTHOR = "cynos, partially based on winamp script"
End Property
Public Property Get URL 'Were can I be found? Where can you get more information?
URL = "http://fma.xinium.com/"
End Property
'Who am I?
Public Property Let Self (s)
m_Self = s
' Some init stuff here:
If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "foobar2000" 'This isn't needed.
If IsEmpty(Settings(Me, "Exe")) or Settings(Me, "Exe") = "" Then Settings(Me, "Exe") = "C:\Program Files\foobar2000\foobar2000.exe"
Set mainMenu = New ManagedMenu
mainMenu.Title = TITLE
End Property
Public Property Get Self
Self = m_Self
End Property
'Display me. Eventually put a menu on the screen
Sub Show()
'--> Init Menu
Dim llist
Set llist = New LinkedList
Dim bi
ActiveXManager("WinampCOMLib.WinampCOMObj").PathExe = Fso.GetParentFolderName(Settings(Me, "Exe")) ' Set up fake API.
bi = llist.BackInserter
bi.Item = Array("1 " & ActiveXManager("WinampCOMLib.WinampCOMObj").GetTitlePlaying, Self & ".fbvoid") ' Get the title playing from the API, doesn't refresh when song ends.
state = ActiveXManager("WinampCOMLib.WinampCOMObj").GetSongState ' Get the state of the song playing.
If state = "Playing" Then
bi.Item = Array("2 Restart", Self & ".Play") 'Restart (Play) track. If order is random, random track.
Elseif state = "Paused" Then
bi.Item = Array("2 Resume", Self & ".Play")
Else
bi.Item = Array("2 Play / Start fb2k", Self & ".Play")
End If
If state = "Paused" Then
bi.Item = Array("3 Resume", Self & ".Pause")
Else
bi.Item = Array("3 Pause", Self & ".Pause")
End If
bi.Item = Array("4 Stop", Self & ".Stopp")
bi.Item = Array("5 Next Track", Self & ".NextTrack")